% run_visualization.m
% Convenience script to run all visualizations for C++ results
% Place this file in the Project3.1 root directory

% Add matlab_visualization directory to path
addpath('matlab_visualization');

% Configuration
case_name = 'Conv_Case0';  % Change this to your case name
data_dir = 'output/visualizations';  % Directory where C++ exports CSV files

% Check if data directory exists
if ~exist(data_dir, 'dir')
    error('Data directory not found: %s. Please run the C++ program first.', data_dir);
end

% Run visualization
fprintf('=== Starting MATLAB Visualization for %s ===\n', case_name);
try
    plot_cpp_results(case_name, data_dir);
    fprintf('=== Visualization completed successfully! ===\n');
    fprintf('Check the matlab_output/%s/ directory for generated plots.\n', case_name);
catch ME
    fprintf('Error during visualization: %s\n', ME.message);
    rethrow(ME);
end
